package com.example.yls.demoa;

import android.animation.TypeEvaluator;

/**
 * Created by yls on 2019/5/9.
 */

public class MyColorEvaluator implements TypeEvaluator<MyColor> {
    @Override
    public MyColor evaluate(float fraction, MyColor star, MyColor end) {
        int red= (int) (star.red+fraction*(end.red-star.red));
        int blue= (int) (star.blue+fraction*(end.blue-star.blue));
        int green= (int) (star.green+fraction*(end.green-star.green));
        MyColor mycolor=new MyColor();
        mycolor.red=red;
        mycolor.blue=blue;
        mycolor.green=green;
        return mycolor;
    }

}
